﻿<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"    
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
  xmlns:ContentControls="clr-namespace:Radovici.Ctrls.ContentControls"
  xmlns:Desktop="clr-namespace:Radovici.Ctrls.Desktop"
  xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
  xmlns:Facebook="clr-namespace:Radovici.Ctrls.Facebook">
    
    <SolidColorBrush x:Key="AeroishBackgroundBrush" Color="Silver" Opacity="0.5"/>
    <SolidColorBrush x:Key="AeroishBorderBrush" Color="Black" Opacity="0.5"/>

    <Style TargetType="Facebook:FacebookMessage">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Facebook:FacebookMessage">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <vsm:VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="PublishedStates">
                                <VisualState x:Name="Published">
                                    <Storyboard>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="NotPublished">
                                    <Storyboard>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <StackPanel Orientation="Horizontal" Cursor="Hand">
                            <TextBlock Text="{Binding ChangeDate}"/>
                            <TextBlock Text="{Binding UserId}"/>
                            <TextBlock Text="{Binding Command}"/>
                            <TextBlock Text="{Binding Parameters}"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Template for connect  -->
    <Style TargetType="Facebook:FacebookConnect">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Facebook:FacebookConnect">
                    <Grid Width="179" Height="52">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="LoginStates">
                                <VisualState x:Name="LoggedIn">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.2" To="0" Storyboard.TargetName="imgLogin" Storyboard.TargetProperty="Opacity"/>
                                        <DoubleAnimation Duration="0:0:0.2" To="1" Storyboard.TargetName="imgLogout" Storyboard.TargetProperty="Opacity"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="LoggedOut">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.2" To="1" Storyboard.TargetName="imgLogin" Storyboard.TargetProperty="Opacity"/>
                                        <DoubleAnimation Duration="0:0:0.2" To="0" Storyboard.TargetName="imgLogout" Storyboard.TargetProperty="Opacity"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Image x:Name="imgLogout" Source="/RadoviciCtrls;component/Resources/fbLogout.png" Cursor="Hand"/>
                        <Image x:Name="imgLogin" Source="/RadoviciCtrls;component/Resources/fbLogin.png" Cursor="Hand"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Template for dragsource  -->
    <Style TargetType="ContentControls:Sizable">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ContentControls:Sizable">                   
                        <Grid>
                            <ContentPresenter Margin="0,0,2,2"/>
                            <Border x:Name="SizeBottomRight" Background="#00ffffff" Cursor="Hand" HorizontalAlignment="Right" VerticalAlignment="Bottom">
                                <Path Data="M20,0 L0,20 L20,20 Z" Stroke="Black">
                                    <Path.Fill>
                                        <LinearGradientBrush StartPoint="0,1" EndPoint="1,0" SpreadMethod="Repeat" MappingMode="Absolute">
                                            <GradientStop Color="#FFAFAFAF" Offset="0"/>
                                            <GradientStop Color="#00FFFFFF" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Path.Fill>
                                </Path>
                            </Border>
                        </Grid>                    
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Template for droptarget  -->
    <Style TargetType="ContentControls:MenuItem">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ContentControls:MenuItem">
                    <Viewbox>
                        <vsm:VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.1" To=".5" Storyboard.TargetName="menuItem" Storyboard.TargetProperty="Opacity"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.1" To="1" Storyboard.TargetName="menuItem" Storyboard.TargetProperty="Opacity"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <ContentPresenter x:Name="menuItem" Cursor="Hand"/>
                    </Viewbox>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="ContentControls:Widget">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ContentControls:Widget">
                    <Border CornerRadius="10" Background="{StaticResource AeroishBackgroundBrush}" BorderBrush="{StaticResource AeroishBorderBrush}" BorderThickness="2">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="25"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="25"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="25"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="25"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock x:Name="TitlePart" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18"/>
                            <Button x:Name="CloseButton" Grid.Row="0" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" Height="18">
                                <Image Source="/RadoviciCtrls;component/Resources/delete2.png"/>
                            </Button>
                            <Border Grid.Row="1" Grid.Column="1" CornerRadius="10" Background="White" BorderBrush="{StaticResource AeroishBorderBrush}" BorderThickness="2">
                                <ContentPresenter Content="{TemplateBinding Content}" Margin="4"/>
                            </Border>
                            <StackPanel x:Name="ButtonPanel" Grid.Row="2" Grid.ColumnSpan="3" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
                                <!--
                                <Button x:Name="CancelButton" Height="18" Width="50" Content="Cancel" Margin="0,0,4,0"/>
                                <Button x:Name="OkButton" Height="18" Width="50" Content="Ok"/>
                                -->
                            </StackPanel>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <!-- Template for dragsource  -->
    <Style TargetType="ContentControls:Dragable">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ContentControls:Dragable">
                    <ContentControl x:Name="DragableContainerPart">
                        <ItemsControl x:Name="DragablePart" Cursor="Hand">
                            <Border x:Name="DragIndicator" Background="#00ffffff" VerticalAlignment="Top" MinHeight="4">
                                <Rectangle Opacity="0.5" >
                                    <Rectangle.Fill>
                                        <LinearGradientBrush StartPoint="2.25,1.75" EndPoint="6.5,6" SpreadMethod="Repeat" MappingMode="Absolute">
                                            <GradientStop Color="#FFAFAFAF" Offset="0"/>
                                            <GradientStop Color="#00FFFFFF" Offset="1"/>
                                            <GradientStop Color="#00FFFFFF" Offset="0.5"/>
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                            </Border>
                            <ContentPresenter x:Name="ContentPresenter" Content="{TemplateBinding Content}" />
                        </ItemsControl>
                    </ContentControl>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Template for droptarget  -->
    <Style TargetType="ContentControls:DropTarget">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ContentControls:DropTarget">
                    <Grid>
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="InteractiveStates">
                                <vsm:VisualState x:Name="Normal">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="border" Storyboard.TargetProperty="BorderBrush" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <SolidColorBrush>Transparent</SolidColorBrush>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Dropable">
                                    <Storyboard>
                                        <!--<ObjectAnimationUsingKeyFrames Storyboard.TargetName="border" Storyboard.TargetProperty="BorderThickness" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness  Left="1" Top="1" Right="1" Bottom="1"/>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>-->
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="border" Storyboard.TargetProperty="BorderBrush" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <SolidColorBrush>RosyBrown</SolidColorBrush>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="MouseOverDropable">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="border" Storyboard.TargetProperty="BorderBrush" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <SolidColorBrush>LightGreen</SolidColorBrush>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Border Background="#00ffffff" VerticalAlignment="Top" MinHeight="4">
                            <Rectangle Opacity="0.5" >
                                <Rectangle.Fill>
                                    <LinearGradientBrush StartPoint="2.25,6" EndPoint="6.5,1.75" SpreadMethod="Repeat" MappingMode="Absolute">
                                        <GradientStop Color="#FFAFAFAF" Offset="0"/>
                                        <GradientStop Color="#00FFFFFF" Offset="1"/>
                                        <GradientStop Color="#00FFFFFF" Offset="0.5"/>
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                        </Border>
                        <Border x:Name="border" BorderThickness="2">
                            <ContentPresenter/>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
